/*
 * Package: org.grassfield.common.service
 * FileName: UserRoleServiceTest.java
 *  
 * Created by pandian on Jan 28, 2011
 */
package service;

import java.util.Set;

import bean.MenuItem;
import bean.UserRole;
import test.BaseTest;


/**
 * A junit test case for UserRoleService.
 */
public class UserRoleServiceTest extends BaseTest {
	private IUserRoleService userRoleService;
	private IMenuListService menuListService;

	/**
	 * Sets the menu list service.
	 * 
	 * @param menuListService the new menu list service
	 */
	public void setMenuListService(IMenuListService menuListService) {
		this.menuListService = menuListService;
	}

	/**
	 * Sets the user role service.
	 * 
	 * @param userRoleService the new user role service
	 */
	public void setUserRoleService(IUserRoleService userRoleService) {
		this.userRoleService = userRoleService;
	}

	/**
	 * Test case for add.
	 */
	public void testAdd() {
		fail("Not yet implemented");
	}

	/**
	 * Test case for find.
	 */
	public void testFind() {
		fail("Not yet implemented");
	}

	/**
	 * Test case for list.
	 */
	public void testList() {
		fail("Not yet implemented");
	}

	/**
	 * Test case for update.
	 */
	public void testUpdate() {
		Long [] selectedMenuItem = new Long[] {1L, 2L, 3L, 4L};
		UserRole userRole = this.userRoleService.find(1L);
		userRole.setName("modified name");
		Set<MenuItem> menuList = this.menuListService.getMenuList(selectedMenuItem);
		userRole.setMenuList(menuList);
		this.userRoleService.update(userRole);
	}

}
